package com.prs.crm.dao.sys.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.sys.FileTypeMaintainDao;
import com.prs.crm.domain.sys.FileTypeMaintain;

public class FileTypeMaintainDaoImpl extends BaseDaoImpl<FileTypeMaintain> implements FileTypeMaintainDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<FileTypeMaintain> getAllFileTypeMaintian() {
		Criteria criteria=this.getSession().createCriteria(FileTypeMaintain.class);
		return criteria.list();
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<FileTypeMaintain> getFileTypeMaintain(String type) {
		Criteria criteria=this.getSession().createCriteria(FileTypeMaintain.class);
		criteria.add(Restrictions.eq("name", type));
		return criteria.list();
	}

}
